package cn.lingyangwl.agile.msg.push.assembly;

import cn.lingyangwl.agile.model.module.config.param.WxMaParam;
import cn.lingyangwl.agile.model.module.config.param.WxMpParam;
import com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProperties;
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author shenguangyang
 */
@Mapper(componentModel = "spring")
public interface MsgChannelParamAssembly {
    MsgChannelParamAssembly INSTANCES = Mappers.getMapper(MsgChannelParamAssembly.class);

    @Mappings({
            @Mapping(source = "appId", target = "appid"),
            @Mapping(source = "appSecret", target = "secret"),
            @Mapping(source = "token", target = "token"),
            @Mapping(source = "encodingAesKey", target = "aesKey")
    })
    WxMaProperties toWxMaProperties(WxMaParam source);

    @Mappings({
            @Mapping(source = "appId", target = "appId"),
            @Mapping(source = "appSecret", target = "secret"),
            @Mapping(source = "token", target = "token"),
            @Mapping(source = "encodingAesKey", target = "aesKey")
    })
    WxMpProperties toWxMpProperties(WxMpParam source);
}
